/** @file
 * @brief Routines to build new labels and label-types.
 */

#ifndef _BUILD_H_
#define _BUILD_H_

/**
 * @brief Copy a string to a new block of memory.
 *
 * If we run out of memory, the process exits.
 * @param str the string to copy
 * @return a pointer to the copy
 */
char *copy(char *str);

/**
 * @brief Allocate a new type struct and add it to the global list of types.
 * @param name the type name
 * @return a pointer to the new struct
 */
Type *addtype(char *name);

/**
 * @brief Define a new label.
 * @param lbltype type of label to define. Will be created if it doesn't already exist.
 * @param lbllevel nesting level of label.
 * @param lblname name by which label will be referred to in cross-references.
 */
void addlbl(char *lbltype, char *lbllevel, char *lblname);

#endif
